package com.dona.imsidetector.db.entity;


import com.dona.imsidetector.utils.DeviceUtil;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

@Table(name = "frequency")
public class Frequency {

    public Frequency(){}


    public Frequency(String band, Integer isp, Integer freq) {
        this.uuid = DeviceUtil.getUUID();
        this.band = band;
        this.isp = isp;
        this.freq = freq;
    }

    @Column(name = "uuid", isId = true)
    private String uuid;

    // 频段
    @Column(name="band")
    private String band;

    // 运营商 1表示移动， 2表示联通 3表示电信 4表示其他
    @Column(name = "isp")
    private Integer isp;


    @Column(name = "freq")
    private Integer freq;

    public String getUuid() {
        return uuid;
    }

    public String getBand() {
        return band;
    }

    public void setBand(String band) {
        this.band = band;
    }

    public Integer getIsp() {
        return isp;
    }

    public String getIspDesc(){
        switch (getIsp()){
            case 1:
                return "移动";
            case 2:
                return "联通";
            case 3:
                return "电信";
            default:
                return "其它";
        }
    }

    public void setIsp(Integer isp) {
        this.isp = isp;
    }


    public Integer getFreq() {
        return freq;
    }

    public void setFreq(Integer freq) {
        this.freq = freq;
    }

    @Override
    public String toString() {
        return "Frequency{" +
                "uuid='" + uuid + '\'' +
                ", band='" + band + '\'' +
                ", isp=" + isp +
                ", freq=" + freq +
                '}';
    }
}
